# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=aardvark-dns
pkgver=1.13.0
pkgrel=0
pkgdesc="Authoritative DNS server for A/AAAA container records"
url="https://github.com/containers/aardvark-dns"
license="Apache-2.0"
# s390x: fails to build due to nix crate
arch="all !s390x"
makedepends="cargo"
source="https://github.com/containers/aardvark-dns/archive/v$pkgver/aardvark-dns-$pkgver.tar.gz"
options="net"

# secfixes:
#   1.12.2-r0:
#     - CVE-2024-8418

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/aardvark-dns \
		-t "$pkgdir"/usr/libexec/podman/
}

sha512sums="
012734539ff13a78b03a61a865aa4e3679a5f153aee75fe132f2727260832b617fd658925f6926e6b978ddaa591fa7da963cbcfa793c86518adec574a46c56da  aardvark-dns-1.13.0.tar.gz
"
